## "Patterns of Political Ideology and Security Policy", Foreign Policy Analysis
## by Tim Haesebrouck (tim.haesebrouck@ugent.be) & Patrick A. Mello (patrick.mello@uni-erfurt.de)

# Packages
library(lattice); library(ggplot2); library(plyr)



# Notation
options("scipen" = 999)

## Table 1: Descriptive Statistics for CHES 2010 and 2014
CHES <- read.csv("CHES 2010-14.csv", header = TRUE, sep = ";")

# Means by country
CHESmeans <- ddply(CHES, .(country), summarize,  lrgen = mean(lrgen), galtan = mean(galtan), support = mean(support))
CHESmeans

# Parties per country
count(CHES$country)

# Means for total dataset
mean(CHES$lrgen)
mean(CHES$galtan)
mean(CHES$support)

## Table 2: Correlations between CHES and CMP data sets
# Merged file with CMP and CHES data (2008-2016)
MRG <- read.csv("CMP CHES 2008-2016.csv", header = TRUE, sep = ";")

# Subsets Eastern Europe & Western Europe
MRGw <- MRG[which(MRG$eastwest == "west"),]
MRGe <- MRG[which(MRG$eastwest == "east"),]

# Correlations
cor.test(MRG$rile, MRG$lrgen, method = "spearman", exact = FALSE)
cor.test(MRGw$rile, MRGw$lrgen, method = "spearman", exact = FALSE)
cor.test(MRGe$rile, MRGe$lrgen, method = "spearman", exact = FALSE)


## Table 4: ANOVA analysis of Support for Peace and Security Missions by Party Family (CHES)
# Party Family, Western and Eastern Europe
PFAM <- read.csv("Party Family.csv", header = TRUE, sep = ";")
# Party Family, Western Europe
PFAMw <- PFAM[which(PFAM$eastwest == "west"),]
# Party Family, Eastern Europe
PFAMe <- PFAM[which(PFAM$eastwest == "east"),]

# Descriptives
count(PFAM$party.family)
count(PFAMw$party.family)
count(PFAMe$party.family)

# Western and Eastern Europe
aggregate(support ~ party.family, data = PFAM, mean)
aggregate(support ~ party.family, data = PFAM, sd)
aggregate(support ~ party.family, data = PFAM, min)
aggregate(support ~ party.family, data = PFAM, max)
PFAMfit <- aov(support ~ party.family, data = PFAM)
summary(PFAMfit)

# Western Europe
aggregate(support ~ party.family, data = PFAMw, mean)
aggregate(support ~ party.family, data = PFAMw, sd)
aggregate(support ~ party.family, data = PFAMw, min)
aggregate(support ~ party.family, data = PFAMw, max)
PFAMwfit <- aov(support ~ party.family, data = PFAMw)
summary(PFAMwfit)

# Eastern Europe
aggregate(support ~ party.family, data = PFAMe, mean)
aggregate(support ~ party.family, data = PFAMe, sd)
aggregate(support ~ party.family, data = PFAMe, min)
aggregate(support ~ party.family, data = PFAMe, max)
PFAMefit <- aov(support ~ party.family, data = PFAMe)
summary(PFAMefit)

## Table 5: Correlations between Party Ideology and Participation in Military Operations

pp <- read.csv("military operations.csv", header = TRUE )
ppe <- pp[ which(pp$Region ==  'East'),]
ppw <- pp[ which(pp$Region ==  'West'),]
pps <- pp[ which(pp$Size ==  'Small States'),]
ppl <- pp[ which(pp$Size ==  'Large States'),]

# Correlations all countries

# Correlations all operations

cor.test(pp$RILE, pp$MP, method = "spearman")
cor.test(pp$CHES, pp$MP, method = "spearman")
cor.test(pp$GALTAN, pp$MP, method = "spearman")

# Correlations inclusive operations

inclusive <- pp[ which(pp$Operation == 'EUFOR Congo' | pp$Operation ==  'UNIFIL' | pp$Operation == 'EUFOR Chad' | pp$Operation == 'Libya' | pp$Operation ==  'Kosovo'),]

cor.test(inclusive$RILE, inclusive$MP, method = "spearman")
cor.test(inclusive$CHES, inclusive$MP, method = "spearman")
cor.test(inclusive$GALTAN, inclusive$MP, method = "spearman")

# Correlations strategic operations

strategic <- pp[ which(pp$Operation == 'IS' | pp$Operation ==  'Iraq' | pp$Operation == 'Afghanistan'),]

cor.test(strategic$RILE, strategic$MP, method = "spearman")
cor.test(strategic$CHES, strategic$MP, method = "spearman")
cor.test(strategic$GALTAN, strategic$MP, method = "spearman")

# Correlations peacekeeping operations

pko <- pp[ which(pp$Operation == 'EUFOR Congo' | pp$Operation ==  'UNIFIL' | pp$Operation == 'EUFOR Chad'),]

cor.test(pko$RILE, pko$MP, method = "spearman")
cor.test(pko$CHES, pko$MP, method = "spearman")
cor.test(pko$GALTAN, pko$MP, method = "spearman")

# Correlations humanitarian interventions

hi <- pp[ which(pp$Operation == 'Libya' | pp$Operation ==  'Kosovo' ),]

cor.test(hi$RILE, hi$MP, method = "spearman")
cor.test(hi$CHES, hi$MP, method = "spearman")
cor.test(hi$GALTAN, hi$MP, method = "spearman")

# Correlations  east

# Correlations all operations

cor.test(ppe$RILE, ppe$MP, method = "spearman")
cor.test(ppe$CHES, ppe$MP, method = "spearman")
cor.test(ppe$GALTAN, ppe$MP, method = "spearman")

# Correlations inclusive operations

inclusive <- ppe[ which(ppe$Operation == 'EUFOR Congo' | ppe$Operation ==  'UNIFIL' | ppe$Operation == 'EUFOR Chad' | ppe$Operation == 'Libya' | ppe$Operation ==  'Kosovo'),]

cor.test(inclusive$RILE, inclusive$MP, method = "spearman")
cor.test(inclusive$CHES, inclusive$MP, method = "spearman")
cor.test(inclusive$GALTAN, inclusive$MP, method = "spearman")

# Correlations strategic operations

strategic <- ppe[ which(ppe$Operation == 'IS' | ppe$Operation ==  'Iraq' | ppe$Operation == 'Afghanistan'),]

cor.test(strategic$RILE, strategic$MP, method = "spearman")
cor.test(strategic$CHES, strategic$MP, method = "spearman")
cor.test(strategic$GALTAN, strategic$MP, method = "spearman")

# Correlations peacekeeping operations

pko <- ppe[ which(ppe$Operation == 'EUFOR Congo' | ppe$Operation ==  'UNIFIL' | ppe$Operation == 'EUFOR Chad'),]

cor.test(pko$RILE, pko$MP, method = "spearman")
cor.test(pko$CHES, pko$MP, method = "spearman")
cor.test(pko$GALTAN, pko$MP, method = "spearman")

# Correlations humanitarian interventions

hi <- ppe[ which(ppe$Operation == 'Libya' | ppe$Operation ==  'Kosovo' ),]

cor.test(hi$RILE, hi$MP, method = "spearman")
cor.test(hi$CHES, hi$MP, method = "spearman")
cor.test(hi$GALTAN, hi$MP, method = "spearman")

# Correlations west

# Correlations all operations

cor.test(ppw$RILE, ppw$MP, method = "spearman")
cor.test(ppw$CHES, ppw$MP, method = "spearman")
cor.test(ppw$GALTAN, ppw$MP, method = "spearman")

# Correlations inclusive operations

inclusive <- ppw[ which(ppw$Operation == 'EUFOR Congo' | ppw$Operation ==  'UNIFIL' | ppw$Operation == 'EUFOR Chad' | ppw$Operation == 'Libya' | ppw$Operation ==  'Kosovo'),]

cor.test(inclusive$RILE, inclusive$MP, method = "spearman")
cor.test(inclusive$CHES, inclusive$MP, method = "spearman")
cor.test(inclusive$GALTAN, inclusive$MP, method = "spearman")

# Correlations strategic operations

strategic <- ppw[ which(ppw$Operation == 'IS' | ppw$Operation ==  'Iraq' | ppw$Operation == 'Afghanistan'),]

cor.test(strategic$RILE, strategic$MP, method = "spearman")
cor.test(strategic$CHES, strategic$MP, method = "spearman")
cor.test(strategic$GALTAN, strategic$MP, method = "spearman")

# Correlations peacekeeping operations

pko <- ppw[ which(ppw$Operation == 'EUFOR Congo' | ppw$Operation ==  'UNIFIL' | ppw$Operation == 'EUFOR Chad'),]

cor.test(pko$RILE, pko$MP, method = "spearman")
cor.test(pko$CHES, pko$MP, method = "spearman")
cor.test(pko$GALTAN, pko$MP, method = "spearman")

# Correlations humanitarian interventions

hi <- ppw[ which(ppw$Operation == 'Libya' | ppw$Operation ==  'Kosovo' ),]

cor.test(hi$RILE, hi$MP, method = "spearman")
cor.test(hi$CHES, hi$MP, method = "spearman")
cor.test(hi$GALTAN, hi$MP, method = "spearman")

# Correlations large

# Correlations all operations

cor.test(ppl$RILE, ppl$MP, method = "spearman")
cor.test(ppl$CHES, ppl$MP, method = "spearman")
cor.test(ppl$GALTAN, ppl$MP, method = "spearman")

# Correlations inclusive operations

inclusive <- ppl[ which(ppl$Operation == 'EUFOR Congo' | ppl$Operation ==  'UNIFIL' | ppl$Operation == 'EUFOR Chad' | ppl$Operation == 'Libya' | ppl$Operation ==  'Kosovo'),]

cor.test(inclusive$RILE, inclusive$MP, method = "spearman")
cor.test(inclusive$CHES, inclusive$MP, method = "spearman")
cor.test(inclusive$GALTAN, inclusive$MP, method = "spearman")

# Correlations strategic operations

strategic <- ppl[ which(ppl$Operation == 'IS' | ppl$Operation ==  'Iraq' | ppl$Operation == 'Afghanistan'),]

cor.test(strategic$RILE, strategic$MP, method = "spearman")
cor.test(strategic$CHES, strategic$MP, method = "spearman")
cor.test(strategic$GALTAN, strategic$MP, method = "spearman")

# Correlations peacekeeping operations

pko <- ppl[ which(ppl$Operation == 'EUFOR Congo' | ppl$Operation ==  'UNIFIL' | ppl$Operation == 'EUFOR Chad'),]

cor.test(pko$RILE, pko$MP, method = "spearman")
cor.test(pko$CHES, pko$MP, method = "spearman")
cor.test(pko$GALTAN, pko$MP, method = "spearman")

# Correlations humanitarian interventions

hi <- ppl[ which(ppl$Operation == 'Libya' | ppl$Operation ==  'Kosovo' ),]

cor.test(hi$RILE, hi$MP, method = "spearman")
cor.test(hi$CHES, hi$MP, method = "spearman")
cor.test(hi$GALTAN, hi$MP, method = "spearman")


# Correlations small

# Correlations all operations

cor.test(pps$RILE, pps$MP, method = "spearman")
cor.test(pps$CHES, pps$MP, method = "spearman")
cor.test(pps$GALTAN, pps$MP, method = "spearman")

# Correlations inclusive operations

inclusive <- pps[ which(pps$Operation == 'EUFOR Congo' | pps$Operation ==  'UNIFIL' | pps$Operation == 'EUFOR Chad' | pps$Operation == 'Libya' | pps$Operation ==  'Kosovo'),]

cor.test(inclusive$RILE, inclusive$MP, method = "spearman")
cor.test(inclusive$CHES, inclusive$MP, method = "spearman")
cor.test(inclusive$GALTAN, inclusive$MP, method = "spearman")

# Correlations strategic operations

strategic <- pps[ which(pps$Operation == 'IS' | pps$Operation ==  'Iraq' | pps$Operation == 'Afghanistan'),]

cor.test(strategic$RILE, strategic$MP, method = "spearman")
cor.test(strategic$CHES, strategic$MP, method = "spearman")
cor.test(strategic$GALTAN, strategic$MP, method = "spearman")

# Correlations peacekeeping operations

pko <- pps[ which(pps$Operation == 'EUFOR Congo' | pps$Operation ==  'UNIFIL' | pps$Operation == 'EUFOR Chad'),]

cor.test(pko$RILE, pko$MP, method = "spearman")
cor.test(pko$CHES, pko$MP, method = "spearman")
cor.test(pko$GALTAN, pko$MP, method = "spearman")

# Correlations humanitarian interventions

hi <- pps[ which(pps$Operation == 'Libya' | pps$Operation ==  'Kosovo' ),]

cor.test(hi$RILE, hi$MP, method = "spearman")
cor.test(hi$CHES, hi$MP, method = "spearman")
cor.test(hi$GALTAN, hi$MP, method = "spearman")

## Figure 1: Party Ideology (CHES Left-Right) and Position towards Peace and Security Missions
# Western and Eastern Europe
CHESw <- CHES[which(CHES$eastwest == "west"),]
CHESe <- CHES[which(CHES$eastwest == "east"),]

# Check linear and quadratic models
attach(CHES)
linear.modelF1 <- lm(lrgen ~ support, CHES)
summary(linear.modelF1)

lrgen2 <- lrgen^2
quadratic.modelF1 <- lm(support ~ lrgen + lrgen2, CHES)
summary(quadratic.modelF1)

# Western Europe
attach(CHESw)
lrgen2 <- lrgen^2  # Quadratic model 
quadratic.modelF1 <- lm(support ~ lrgen + lrgen2, CHESw)
summary(quadratic.modelF1) # R^2 value

# Eastern Europe
attach(CHESe)
lrgen2 <- lrgen^2  # Quadratic model 
quadratic.modelF1 <- lm(support ~ lrgen + lrgen2)
summary(quadratic.modelF1) # R^2 value

# Plot
library(ggplot2)
F1 = ggplot(data = CHES, aes(x = lrgen, y = support)) +
  stat_smooth(color = "gray30", method = "lm", formula = y ~ poly(x,2), size = 0.8, se = TRUE, level = 0.95) +
  geom_point(data = CHESw, color = "dodgerblue2", alpha = 0.9, size = 2.8, shape = 21, stroke = 1, na.rm = TRUE) +
  geom_point(data = CHESe, color = "orangered1", alpha = 0.9, size = 2.8, shape = 21, stroke = 1, na.rm = TRUE) +
  theme_classic() +
  theme(panel.border = element_rect(fill = NA, color = "black", size = 1, linetype = 1)) +
  theme(axis.text.y = element_text(size = 14, color = "black"), axis.title = element_text(size = 15)) +
  theme(axis.text.x = element_text(size = 14, color = "black",
                                   angle = 0, hjust = 0.5), axis.title = element_text(size = 15)) +
  scale_y_continuous(name = "Position towards Peace and Security Missions (Strong Opposition to Strong Support)",
                     limits = c(0,10), breaks = c(seq(0,10,1)), expand = c(0.03,0.03)) +
  scale_x_continuous(name = "Party Ideology (CHES Left to Right)", limits = c(0,10),
                     breaks = c(seq(0,10,1)), expand = c(0.03,0.03)) +
  geom_hline(yintercept = c(5), size = 0.3, color = "gray65", linetype = "solid") +
  geom_vline(xintercept = c(5), size = 0.3, color = "gray65", linetype = "solid") +
  ggplot2::annotate("point", x = 0.2, y = 9.8, shape = 21, color = "dodgerblue2", alpha = 0.9, size = 3, stroke = 1) +
  ggplot2::annotate("text", x = 0.4, y = 9.8, label = "Western European Parties", size = 5, hjust = 0) +
  ggplot2::annotate("point", x = 0.2, y = 9.5, shape = 21, color = "orangered1", alpha = 1, size = 3, stroke = 1) +
  ggplot2::annotate("text", x = 0.4, y = 9.5, label = "Eastern European Parties", size = 5, hjust = 0) +
  ggplot2::annotate("text", x = 0.1, y = 9.0, label = "R^2 == 0.4089", size = 5, hjust = 0, parse = TRUE) +
  ggplot2::annotate("text", x = 0.1, y = 8.7, label = "p < .0001", size = 5, hjust = 0, parse = TRUE)
F1

## Figure 2: Party Ideology (CHES GAL/TAN) and Position towards Peace and Security Missions

# Check linear and quadratic models
attach(CHES)
linear.modelF2 <- lm(galtan ~ support)
summary(linear.modelF2) 

galtan2 <- galtan^2
quadratic.modelF2 <- lm(support ~ galtan + galtan2)
summary(quadratic.modelF2)

F2 = ggplot(data = CHES, aes(x = galtan, y = support)) +
  stat_smooth(color = "gray30", method = "lm", formula = y ~ poly(x,2), size = 0.8, se = TRUE, level = 0.95) +
  geom_point(data = CHESw, color = "dodgerblue2", alpha = 0.9, size = 2.8, shape = 21, stroke = 1, na.rm = TRUE) +
  geom_point(data = CHESe, color = "orangered1", alpha = 0.9, size = 2.8, shape = 21, stroke = 1, na.rm = TRUE) +
  theme_classic() +
  theme(panel.border = element_rect(fill = NA, color = "black", size = 1, linetype = 1)) +
  theme(axis.text.y = element_text(size = 14, color = "black"), axis.title = element_text(size = 15)) +
  theme(axis.text.x = element_text(size = 14, color = "black", angle = 0, hjust = 0.5), axis.title = element_text(size = 15)) +
  scale_y_continuous(name = "Position towards Peace and Security Missions (Strong Opposition to Strong Support)",
                     limits = c(0,10), breaks = c(seq(0,10,1)), expand = c(0.03,0.03)) +
  scale_x_continuous(name = "Party Position (Libertarian/Postmaterialist to Traditional/Authoritarian)", 
                     breaks = c(seq(0,10,1)), expand = c(0.03,0.03)) +
  geom_hline(yintercept = c(5), size = 0.3, color = "gray65", linetype = "solid") +
  geom_vline(xintercept = c(5), size = 0.3, color = "gray65", linetype = "solid") +
  ggplot2::annotate("point", x = 0.2, y = 9.8, shape = 21, color = "dodgerblue2", stroke = 1, alpha = 0.9, size = 3) +
  ggplot2::annotate("text", x = 0.4, y = 9.8, label = "Western European Parties", size = 5, hjust = 0) +
  ggplot2::annotate("point", x = 0.2, y = 9.5, shape = 21, color = "orangered1", stroke = 1, alpha = 1, size = 3) +
  ggplot2::annotate("text", x = 0.4, y = 9.5, label = "Eastern European Parties", size = 5, hjust = 0) +
  ggplot2::annotate("text", x = 0.1, y = 9.0, label = "R^2 == 0.1286", size = 5, hjust = 0, parse = TRUE) +
  ggplot2::annotate("text", x = 0.1, y = 8.7, label = "p < .0001", size = 5, hjust = 0, parse = TRUE)
F2

## Figure 3: Party Ideology (CMP Left-Right) and Position towards Peace and Security Missions
attach(MRG)

# Check linear and quadratic models
linear.modelF3 <- lm(rile ~ support) 
summary(linear.modelF3) 

rile2 <- rile^2 
quadratic.modelF3 <- lm(support ~ rile + rile2)
summary(quadratic.modelF3)

F3 = ggplot(data = MRG, aes(x = rile, y = support)) +
  stat_smooth(color = "gray30", method = "lm", formula = y ~ poly(x,2), se = TRUE, level = 0.95, size = 0.8) +
  geom_point(data = MRGw, color = "dodgerblue2", alpha = 0.9, size = 2.8, shape = 21, stroke = 1, na.rm = TRUE) +
  geom_point(data = MRGe, color = "orangered1", alpha = 0.9, size = 2.8, shape = 21, stroke = 1, na.rm = TRUE) +
  theme_classic() +
  theme(panel.border = element_rect(fill = NA, color = "black", size = 1, linetype = 1)) +
  theme(axis.text.y = element_text(size = 14, color = "black"), axis.title = element_text(size = 15)) +
  theme(axis.text.x = element_text(size = 14, color = "black", angle = 0, hjust = 0.5), axis.title = element_text(size = 15)) +
  scale_y_continuous(name = "Position towards Peace and Security Missions (Strong Opposition to Strong Support)",
                     limits = c(0,10), breaks = c(seq(0,10,1)), expand = c(0.01,0.01)) +
  scale_x_continuous(name = "Party Ideology (CMP Left to Right)", 
                     limits = c(-55,75), breaks = c(seq(-50,75,10)), expand = c(0.01,0.01)) +
  geom_hline(yintercept = c(5), size = 0.3, color = "gray65", linetype = "solid") +
  geom_vline(xintercept = c(0), size  = 0.3, color = "gray65", linetype = "solid") +
  ggplot2::annotate("point", x = -50, y = 9.8, shape = 21, color = "dodgerblue2", stroke = 1, alpha = 0.9, size = 3) +
  ggplot2::annotate("text", x = -48, y = 9.8, label = "Western European Parties", size = 5, hjust = 0) +
  ggplot2::annotate("point", x = -50, y = 9.5, shape = 21, color = "orangered1", stroke = 1, alpha = 1, size = 3) +
  ggplot2::annotate("text", x = -48, y = 9.5, label = "Eastern European Parties", size = 5, hjust = 0) +
  ggplot2::annotate("text", x = -51, y = 9.0, label = "R^2 == 0.1167", size = 5, hjust = 0, parse = TRUE) +
  ggplot2::annotate("text", x = -51, y = 8.7, label = "p < .0001", size = 5, hjust = 0, parse = TRUE)
F3

## Figure 4: Party Family (CHES) and Position towards Peace and Security Missions
PFAM <- read.csv("Family.csv", header = TRUE, sep = ";")
PFAM$party.family <- factor(PFAM$party.family, c("Radical Left", "Greens", "Socialists",
                                                 "Liberal", "Conservatives and Christian Democrats", "Radical Right"))
levels(PFAM$party.family) <- gsub(" ", "\n", levels(PFAM$party.family))

# Eastern and Western Europe
PFAMw <- PFAM[which(PFAM$eastwest == "west"),]
PFAMe <- PFAM[which(PFAM$eastwest == "east"),]

# Linebreaks for Party Family labels 
addline_format <- function(x,...){
  gsub('\\s','\n',x)
}

F4 = ggplot(data = PFAM) +
  geom_hline(yintercept = c(5), size = 0.7, color = "gray45", linetype = "dotted") +
  geom_boxplot(aes(x = party.family, y = support), size = 0.7, color = "gray30", fill = "gray90", alpha = 0.5, shape = 18, na.rm = TRUE) +
  geom_point(aes(x = party.family, y = support), data = PFAMw, color = "dodgerblue2", alpha = 0.9, size = 3, shape = 21, stroke = 1.2, 
             position = position_jitter(width = 0.2, height = 0.05)) +
  geom_point(aes(x = party.family, y = support), data = PFAMe, color = "orangered1", alpha = 0.9, size = 3, shape = 21, stroke = 1.2,
             position = position_jitter(width = 0.2, height = 0.05)) +
  theme_classic() +
  theme(panel.border = element_rect(fill = NA, color = "black", size = 1, linetype = 1)) +
  theme(axis.text.y = element_text(size = 14, color = "black"), axis.title = element_text(size = 14)) +
  scale_y_continuous(name = "Position towards Peace and Security Missions (Strong Opposition to Strong Support)",
                     limits = c(0,10), breaks = c(seq(0,10,1)), expand = c(0.03,0.03)) +
  theme(axis.text.x = element_text(size = 14, color = "black", angle = 0, hjust = 0.5)) +
  scale_x_discrete(name = "Party Family") +
  ggplot2::annotate("point", x = 0.6, y = 9.8, shape = 21, color = "dodgerblue2", stroke = 1.2, alpha = 0.9, size = 3) +
  ggplot2::annotate("text", x = 0.7, y = 9.8, label = "Western European Parties", size = 5, hjust = 0) +
  ggplot2::annotate("point", x = 0.6, y = 9.5, shape = 21, color = "orangered1", stroke = 1.2, alpha = 1, size = 3) +
  ggplot2::annotate("text", x = 0.7, y = 9.5, label = "Eastern European Parties", size = 5, hjust = 0)
F4

## Figure 5 Government Ideology (CMP) and Participation in Military Operations


all= ggplot(pp, aes(x=Participation, y = RILE))+
  geom_hline(yintercept=c(0), size=0.7, color="gray65", linetype="dotted") +
  geom_boxplot(size=1, color="gray30", fill="white", alpha=0.1, shape=18, na.rm = TRUE)+
  geom_point(aes(x=Participation, y=RILE), color="dodgerblue2", alpha=0.9, size=2.8, shape=19, position = position_jitter(width = 0.2, height = 0.05)) +
  theme_classic() +
  theme(panel.border = element_rect(fill = NA, color = "black", size = 1, linetype = 1)) +
  theme(axis.text.y=element_text(size=12, color="black"), axis.title=element_text(size=13)) +
  theme(axis.text.x=element_text(size=12, color="black", angle = 0, hjust = 0.5), axis.title=element_text(size=13)) +
  scale_y_continuous(name="Party Position (CMP Left to Right)", limits=c(-50,50), breaks=c(seq(-50,50,10)), expand = c(0.03,0.03)) +
  labs(x = "Military Participation")
all


## Figure 6 Government Ideology (CMP) and Military Participation: Inclusive vs. Strategic Goals

type= ggplot(pp, aes(x=Participation, y = RILE))+
  geom_hline(yintercept=c(0), size=0.7, color="gray65", linetype="dotted") +
  geom_boxplot(size=1, color="gray30", fill="white", alpha=0.1, shape=18, na.rm = TRUE)+
  geom_point(aes(x=Participation, y=RILE), color="dodgerblue2", alpha=0.9, size=2.8, shape=19, position = position_jitter(width = 0.2, height = 0.05)) +
  theme_classic() +
  theme(panel.border = element_rect(fill = NA, color = "black", size = 1, linetype = 1)) +
  theme(axis.text.y=element_text(size=12, color="black"), axis.title=element_text(size=13)) +
  theme(axis.text.x=element_text(size=12, color="black", angle = 0, hjust = 0.5), axis.title=element_text(size=13)) +
  scale_y_continuous(name="Party Position (CMP Left to Right)", limits=c(-50,50), breaks=c(seq(-50,50,10)), expand = c(0.03,0.03)) +
  labs(x = "Military Participation") +
  facet_grid(. ~ Type)
type


## Figure A1 Humanitarian Interventions vs. Peacekeeping Operations


inclusive <- pp[ which(pp$Operation == 'EUFOR Congo' | pp$Operation ==  'UNIFIL' | pp$Operation == 'EUFOR Chad' | pp$Operation == 'Libya' | pp$Operation ==  'Kosovo'),]

typeinclusive= ggplot(inclusive, aes(x=Participation, y = RILE))+
  geom_hline(yintercept=c(0), size=0.7, color="gray65", linetype="dotted") +
  geom_boxplot(size=1, color="gray30", fill="white", alpha=0.1, shape=18, na.rm = TRUE)+
  geom_point(aes(x=Participation, y=RILE), color="dodgerblue2", alpha=0.9, size=2.8, shape=19, position = position_jitter(width = 0.2, height = 0.05)) +
  theme_classic() +
  theme(panel.border = element_rect(fill = NA, color = "black", size = 1, linetype = 1)) +
  theme(axis.text.y=element_text(size=12, color="black"), axis.title=element_text(size=13)) +
  theme(axis.text.x=element_text(size=12, color="black", angle = 0, hjust = 0.5), axis.title=element_text(size=13)) +
  scale_y_continuous(name="Party Position (CMP Left to Right)", limits=c(-50,50), breaks=c(seq(-50,50,10)), expand = c(0.03,0.03)) +
  labs(x = "Military Participation")+
  facet_grid(. ~ Typeinclus)
typeinclusive


## Figure A2 Small vs. Large States

sizetype = ggplot(pp, aes(x=Participation, y = RILE))+
  geom_hline(yintercept=c(0), size=0.7, color="gray65", linetype="dotted") +
  geom_boxplot(size=1, color="gray30", fill="white", alpha=0.1, shape=18, na.rm = TRUE)+
  geom_point(aes(x=Participation, y=RILE), color="dodgerblue2", alpha=0.9, size=2.8, shape=19, position = position_jitter(width = 0.2, height = 0.05)) +
  theme_classic() +
  theme(panel.border = element_rect(fill = NA, color = "black", size = 1, linetype = 1)) +
  theme(axis.text.y=element_text(size=12, color="black"), axis.title=element_text(size=13)) +
  theme(axis.text.x=element_text(size=12, color="black", angle = 0, hjust = 0.5)) +
  facet_grid(Type ~ Size) +
  scale_y_continuous(name="Party Position (CMP Left to Right)", limits=c(-50,50), breaks=c(seq(-50,50,10)), expand = c(0.03,0.03)) +
  labs(x = "Military Participation")
sizetype

## Figure A3 Eastern Europe vs. Western Europe in Peacekeeping Operations

pko <- pp[ which(pp$Operation == 'EUFOR Congo' | pp$Operation ==  'UNIFIL' | pp$Operation == 'EUFOR Chad'),]

regionpko = ggplot(pko, aes(x=Participation, y = GALTAN))+
  geom_hline(yintercept=c(5), size=0.7, color="gray65", linetype="dotted") +
  geom_boxplot(size=1, color="gray30", fill="white", alpha=0.1, shape=18, na.rm = TRUE)+
  geom_point(aes(x=Participation, y=GALTAN), color="dodgerblue2", alpha=0.9, size=2.8, shape=19, position = position_jitter(width = 0.2, height = 0.05)) +
  theme_classic() +
  theme(panel.border = element_rect(fill = NA, color = "black", size = 1, linetype = 1)) +
  theme(axis.text.y=element_text(size=12, color="black"), axis.title=element_text(size=13)) +
  scale_y_continuous(name="Party Position (Libertarian/Postmaterialst to Traditional/Authoritarian)", limits=c(0,10), breaks=c(seq(0,10,1)), expand = c(0.03,0.03)) +
  labs(x = "Military Participation")+
  theme(axis.text.x=element_text(size=12, color="black", angle = 0, hjust = 0.5)) +
  facet_grid(. ~ Region)
regionpko



# End
